﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtBusiness;
using WF_Business;

public partial class OFFICE_BackRecord : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string iid = Request.QueryString["iid"];

            if (!string.IsNullOrEmpty(iid))
            {
                System.Data.DataTable rs = new System.Data.DataTable();
                string Sql = string.Format(@"SELECT t.wiid,
                       t.szgw,
                       t.yj,
                       t.backtime,
                       (select user_name from st_user a where a.userid = t.userid) yh
                  FROM st_back T
                 WHERE T.iid = '{0}'
                union
                SELECT to_char(b.岗位编号) wiid,
                       b.岗位 szgw,
                       b.remark yj,
                       b.接件时间 backtime,
                       b.经办人 yh
                  FROM sv_work_item_list b
                 WHERE b.编号 = '{0}'
                 and b.remark is not null", iid);
                SysParams.OAConnection().RunSql(Sql, out rs);

                this.GridView1.DataSource = rs;
                this.GridView1.DataBind();
            }
        }
    }
}
